package com.smooth.mall.exception;

import com.smooth.mall.common.ApiRestResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

public class SmoothMallException extends RuntimeException{

    private Integer code;
    private String msg;

    public SmoothMallException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public SmoothMallException(SmoothMallExceptionEnum smoothMallExceptionEnum){
        this(smoothMallExceptionEnum.getCode(),smoothMallExceptionEnum.getMsg());
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
